package com.changgou.dao;

import com.changgou.pojo.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

/**
 * @author: hushengjin
 */
public interface UserInfoMapper extends Mapper<UserInfo> {

    @Update("update user_info set money=money-#{money} where account=#{username} and money>=#{money}")
    int decrMoney(@Param("username") String username, @Param("money") int money);

}
